# coding=gb2312
import redis
from datetime import datetime
import AdaoRedis
#import time

        
if __name__ == '__main__':
    redis_svr =  'localhost'
    r = redis.Redis(redis_svr, db=1)
    
    r.flushall()

    start_time = datetime.now()
    for i in range(1,20000):
        dict2 = {'name': 'earth', 'port': 80}
        r.hmset(i, dict2)
        #r.hset(i,'instru','-i fj1')
        #r.hset(i,'time', 10)        
        
    

    r.save()
    print 'cost', datetime.now()-start_time